starter.controller('bookingController', function($rootScope,$state,$ionicPopup,$timeout,$scope,Page, localStore,$location,$ionicHistory) {
	
	$scope.lineId = $state.params.lineId;
	$scope.planStatus = $state.params.planStatus;
	
	$scope.booking = {};
 	
 	Page.ajaxPostQuiet('line/detail.do',{lineId: $scope.lineId,planStatus: $scope.planStatus},function(resp){
 		$scope.booking = {
 			line : resp.data
 		};
 		Page.ajaxPostQuiet('line/stops.do',{lineId : $scope.lineId},function(resp){
	 		$scope.lineStop.init(resp.data);
	 		$scope.booking.line.stops = resp.data;
		});
 		$state.go('booking.plan');
	});
		
		
});